package io;

import javax.imageio.stream.FileImageOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class FlushDemo {
    public static void main(String[] args) throws IOException {

        String name = "姜可";
        int age= 22;
        String gender = "男";
        String  [] otherInfo={"天青色等烟雨"};
        Student jk=new Student(name,age,gender,otherInfo);

        System.out.println(jk);


        FileOutputStream fos = new FileOutputStream("text1.txt");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(jk);
        System.out.println("输入完毕！");
        oos.close();

//        String name1 = "坤哥";
//        int age1=18;
//        String gender1="男";
//        String [] arr1={"你是我幻多患失的梦，我是你可有可无的人"};
//        Student kunge=new Student(name1,age1,gender1,arr1);
//        FileOutputStream fos1= new FileOutputStream("text2.txt");
//        ObjectOutputStream oos1=new ObjectOutputStream(fos1);
//        oos1.writeObject(kunge);
//
//        fos1.close();




    }
}
